package com.zzh.zzhaiagent.utils;

import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author 张 志 豪
 * @version 1.0
 * 发放一个UserAccount账户 (保证唯一性！防止重复)
 */
public class UserAccountUtils {

    private static final String  ACCOUNT_PREFIX = "AI*LM_";

    public static String generateUserAccount(String email) {
        //用邮箱前缀作为账户后缀
        if (!EmailRightUtils.isRightEmail(email)){
            return null;
        }
        String[] split = email.split("@");
        if (split.length == 0) {
            return null;
        }
        String emailPrefix = split[0];
        return ACCOUNT_PREFIX + emailPrefix;
    }

}
